package linker.list;

import javax.swing.ImageIcon;
import javax.swing.JFrame;

import linker.account.Account;
import linker.account.ManageAccount;

/**
 * 
 * @version linker 0.93
 * @author Jianfeng jianfeng.linker@gmail.com
 * 
 */
public class StringMessage extends DefaultListItem {

	private String message;

	private JFrame window;

	private static ImageIcon stringIcon = new ImageIcon(ManageAccount
			.getImagePath()
			+ "stringmessage.png");

	public StringMessage(String message, JFrame window) {
		this.message = message;

		this.window = window;
	}

	public String toString() {
		return message;
	}

	public void doubleClick() {
		window.setVisible(true);

		Account.removeMessage(this);
	}

	public void setRender(CellRender render) {
		render.setIcon(stringIcon);
	}

}
